package com.example.loggingservice.controller;

import com.example.loggingservice.common.R;
import com.example.loggingservice.entity.OperationLog;
import com.example.loggingservice.service.LoggingService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class LogController {

    private final LoggingService loggingService;

    @GetMapping("/logs")
    public R<List<OperationLog>> getAllLogs() {
        List<OperationLog> logs = loggingService.getAllLogs();
        return R.success(logs);
    }
} 